


* Replication file for Van der Maat, Eelco. "Genocidal Consolidation: Final Solutions to Elite Rivalry," International Organization
* All analyses were done in Stata/IC 11.0 for Mac.

* This is the Stata replication of the second analysis; it contains:

	* replication of Crosstab Figure 3 (p 35)
	* replication of Table 5
	* replication of Table A.5 and A.6 of Appendix D
	* replication of Table A.11 of Appendix G



version 11.0
clear all
set mem 500m
capture log close
set more off

* set working directory
cd "/Users/eelco/Dropbox/Academic/Journal submissions/IO 2019/Final Manuscript/IO_GC_replication/IO_GC_replication_II"



** Packages:

 * ssc install fitstat






****************************************************************************
*** Crosstab Figure 3 (page 35)                                          ***
****************************************************************************


****** 1) Country data
use  "purge_data.dta", clear


tab elite_purge genocide, col chi2

****** 2) all mass violence observations

use  "purge_data.dta", clear
keep if genocide==1 | cgv==1
tab elite_purge genocide, col chi2

****** 3) at-risk observations

use  "purge_atrisk_data.dta", clear
tab elite_purge genocide, col chi2



****** 4) Leaders that initiated genocidal consolidation (digenonset)

use  "purge_data.dta", clear
keep if digenonset==1
tab elite_purge genocide, col chi2








****************************************************************************
*** table 5 (page 37)                                                    ***
****************************************************************************


use  "purge_data.dta", clear



****************************************************************************
****************************************************************************
****                                                                    ****
****    genocide -> purge models                                        ****
****    Main analyses                                                   ****
****                                                                    ****
****************************************************************************
****************************************************************************


* set random seed to repeat postestimation outcomes:
set seed 12345

*** Column I

*** 1) purges occur during MIV - lagged

use  "purge_data.dta", clear
probit elite_purge lmiv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column II

*** 2) purges occur during genocidal consolidation - lagged

use  "purge_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column III

*** 3) no milita:lagged


use  "purge_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2, cluster(ccode)
fitstat, sav(r2_1)




*** Column IV

**** 4) coding for precise temporal order

use  "purge_tempor_data.dta", clear
probit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)

** Effects (page 36)

estsimp probit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
setx median
simqi, listx
simqi, fd(pr) changex(genocide 0 1) listx
setx genocide 1
simqi, listx



*** Column V

* 5) at-risk sample; coding for precise temporal order


use  "purge_atrisk_tempor_data.dta", clear
probit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)

** Effects estimates (page 38)

estsimp probit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
setx median
simqi, listx
simqi, fd(pr) changex(genocide 0 1) listx
setx genocide 1
simqi, listx



****************************************************************************
****************************************************************************
****                                                                    ****
****    Table A.5 of Appendix  D.                                       ****
****                                                                    ****
****************************************************************************
****************************************************************************


****************************************************************************
****    civil conflict                                                  ****
****************************************************************************


*** Column I, Table A.5 in Appendix

*** 1) purges occur during MIV � lagged

use  "purge_data.dta", clear
probit elite_purge lmiv conflict popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column II, Table A.5 in Appendix

*** 2) purges occur during genocidal consolidation - lagged

use  "purge_data.dta", clear
probit elite_purge lgenocide lcgv conflict popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column III, Table A.5 in Appendix

*** 3) no milita:lagged

use  "purge_data.dta", clear
probit elite_purge lgenocide lcgv conflict popl gdppcl polity tenure newleader2, cluster(ccode)
fitstat, sav(r2_1)



*** Column IV

**** 4) coding for precise temporal order

use  "purge_tempor_data.dta", clear
probit elite_purge genocide cgv conflict popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)



*** Column V

* 5) at-risk sample; coding for precise temporal order

use  "purge_atrisk_tempor_data.dta", clear
probit elite_purge genocide cgv conflict popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


****************************************************************************
****    random effects                                                   ****
****************************************************************************


*** Column VI 

*** 1) purges occur during MIV � lagged, random effects

use  "purge_data.dta", clear

* data already sorted but to be sure
sort ccode year

* xtset data by country code and year
xtset ccode year

* random effects probit
xtprobit elite_purge lmiv guerrilla popl gdppcl polity tenure newleader2 militia, re

*Calculate Nagelkerke R2:
	*full model
	xtprobit elite_purge lmiv guerrilla popl gdppcl polity tenure newleader2 militia, re
	sca llfull= e(ll)
	*intercept only
	xtprobit elite_purge if e(sample), re
	sca llbase= e(ll)
	display (1-(exp(llbase)/exp(llfull))^(2/e(N))) / (1-(exp(llbase))^(2/e(N)))
	sca drop llfull llbase



*** Column VII, Table A.5 in Appendix

*** 2) purges occur during genocidal consolidation - lagged, random effects

use  "purge_data.dta", clear

sort ccode year
xtset ccode year
xtprobit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2 militia, re

*Calculate Nagelkerke R2:

	sca llfull= e(ll)
	*intercept only
	xtprobit elite_purge if e(sample), re
	sca llbase= e(ll)
	display (1-(exp(llbase)/exp(llfull))^(2/e(N))) / (1-(exp(llbase))^(2/e(N)))
	sca drop llfull llbase



*** Column VIII, Table A.5 in Appendix

* 3) no milita:lagged, random effects

use  "purge_data.dta", clear

sort ccode year
xtset ccode year
xtprobit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2, re

*Calculate Nagelkerke R2:

	sca llfull= e(ll)
	*intercept only
	xtprobit elite_purge if e(sample), re
	sca llbase= e(ll)
	display (1-(exp(llbase)/exp(llfull))^(2/e(N))) / (1-(exp(llbase))^(2/e(N)))
	sca drop llfull llbase



*** Column IX, Table A.5 in Appendix

*** 4) coding for precise temporal order, random effects

use  "purge_tempor_data.dta", clear

sort ccode year
xtset ccode year
xtprobit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, re

*Calculate Nagelkerke R2:

	sca llfull= e(ll)
	*intercept only
	xtprobit elite_purge if e(sample), re
	sca llbase= e(ll)
	display (1-(exp(llbase)/exp(llfull))^(2/e(N))) / (1-(exp(llbase))^(2/e(N)))
	sca drop llfull llbase


*** Column X, Table A.5 in Appendix

* 5) at-risk sample; coding for precise temporal order, random effects

use  "purge_atrisk_tempor_data.dta", clear

sort ccode year
xtset ccode year
xtprobit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, re

*Calculate Nagelkerke R2:

	sca llfull= e(ll)
	*intercept only
	xtprobit elite_purge if e(sample), re
	sca llbase= e(ll)
	display (1-(exp(llbase)/exp(llfull))^(2/e(N))) / (1-(exp(llbase))^(2/e(N)))
	sca drop llfull llbase




****************************************************************************
****************************************************************************
****                                                                    ****
****    Table A.6 of Appendix  D.                                       ****
****                                                                    ****
****************************************************************************
****************************************************************************



****************************************************************************
****    Other  at-risk models                                            ***
****************************************************************************



*** Column I, Table A.6 in Appendix

*** 1) purges occur during MIV � lagged, at risk

use  "purge_atrisk_data.dta", clear
probit elite_purge lmiv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)





*** Column II, Table A.6 in Appendix

*** 2) purges occur during genocidal consolidation - lagged, at risk

use  "purge_atrisk_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column III, Table A.6 in Appendix

*** 3) no milita:lagged, at risk

use  "purge_atrisk_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2, cluster(ccode)
fitstat, sav(r2_1)



****************************************************************************
****    at-risk with all genocidal consolidation observations.           ***
****************************************************************************


*** Column IV, Table A.6 in Appendix


*** 1) at-risk; all genocidal consolidation obs; purges occur during MIV spell; lagged

use  "purge_atrisk_genobs_data.dta", clear
probit elite_purge lmiv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column V, Table A.6 in Appendix

*** 2) at-risk; all genocidal consolidation obs; purges occur during genocide spell; lagged

use  "purge_atrisk_genobs_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)


*** Column VI, Table A.6 in Appendix

*** 3) at-risk; all genocidal consolidation obs; purges occur during genocide spell; no militia; lagged

use  "purge_atrisk_genobs_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity tenure newleader2, cluster(ccode)
fitstat, sav(r2_1)



*** Column VII, Table A.6 in Appendix

*** 4) at-risk; all genocidal consolidation obs; purges occur during genocide spell; precise temporal order

use  "purge_atrisk_genobs_tempor_data.dta", clear
probit elite_purge genocide cgv guerrilla popl gdppcl polity tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)




****************************************************************************
****************************************************************************
****                                                                    ****
****    Table A.11 of Appendix  G.                                      ****
****                                                                    ****
****************************************************************************
****************************************************************************



****************************************************************************
****      Horizontal inequality                                         ****
****************************************************************************


*** Column I, Table A.11 of Appendix G

*** 1) purges occur during MIV - lagged, with Horizontal Inequality

use  "purge_data.dta", clear
probit elite_purge lmiv guerrilla popl gdppcl polity discriminate tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)



*** Column II, Table A.11 of Appendix G

*** 2) purges occur during genocidal consolidation - lagged, with Horizontal Inequality

use  "purge_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity discriminate tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)



*** Column III, Table A.11 of Appendix G

*** 3) no milita:lagged with Horizontal Inequality

use  "purge_data.dta", clear
probit elite_purge lgenocide lcgv guerrilla popl gdppcl polity discriminate tenure newleader2, cluster(ccode)
fitstat, sav(r2_1)



*** Column IV, Table A.11 of Appendix G

**** 4) coding for precise temporal order with Horizontal Inequality

use  "purge_tempor_data.dta", clear
probit elite_purge genocide cgv guerrilla popl gdppcl polity discriminate tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)



*** Column V, Table A.11 of Appendix G

* 5) at-risk sample; coding for precise temporal order with Horizontal Inequality

use  "purge_atrisk_tempor_data.dta", clear
probit elite_purge genocide cgv guerrilla popl gdppcl polity discriminate tenure newleader2 militia, cluster(ccode)
fitstat, sav(r2_1)





